﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace LogicUniversityBiz
{
    [Serializable]
    public class Discrepancy : ISerializable
    {
        private int voucherID;
        private string itemCode;
        private int quantityAdj;
        private string reason;
        private decimal totalCost;

        public Discrepancy() { }

        public Discrepancy(SerializationInfo info, StreamingContext ctxt)
        {
            //Get the values from info and assign them to the appropriate properties
            itemCode = (string)info.GetValue("ItemCode", typeof(string));
            quantityAdj = (int)info.GetValue("QuantityAdj", typeof(int));
            reason = (string)info.GetValue("Reason", typeof(string));
            totalCost = (decimal)info.GetValue("TotalCost", typeof(decimal));
        }
        public string ItemCode
        {
            get { return this.itemCode; }
            set { this.itemCode = value; }
        }
        public string Reason
        {
            get { return this.reason; }
            set { this.reason = value; }
        }

        public int QuantityAdj
        {
            get { return this.quantityAdj; }
            set { this.quantityAdj = value; }
        }

        public int VoucherID
        {
            get { return this.voucherID; }
            set { this.voucherID = value; }
        }

        public decimal TotalCost
        {
            get { return this.totalCost; }
            set { this.totalCost = value; }
        }

        public void GetObjectData(SerializationInfo info, StreamingContext ctx)
        {
            info.AddValue("ItemCode", itemCode);
            info.AddValue("QuantityAdj", quantityAdj);
            info.AddValue("Reason", reason);
            info.AddValue("TotalCost", totalCost);
        }
    }
}
